home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.lib;
-
- import sub_arctic.input.*;
- import sub_arctic.output.*;
-
- /**
- * This is a version of a toggle which implements the look of a radio
- * button via the style system.
- *
- * @author Ian Smith
- */
-
- public class radio_button extends toggle {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Make a radio button in the current style.
- *
- * @param int x the x position of this interactor.
- * @param int y the y position of this interactor.
- * @param toggle group_with what other toggle this radio_button
- * should be grouped with (if you pass
- * null here the radio button is "free
- * standing" and should probably be a
- * checkbox instead).
- * @param callback_object co the object to send the callbacks to.
- */
- public radio_button(int x, int y, toggle group_with, callback_object co)
- {
-
- // default to the artkit look temporarily
- super(x,y,co);
-
- /* set the style stuff going */
- style_changed();
-
- /* set the toggle you are with */
- if (group_with!=null) {
- add_to_group_of(group_with);
- }
- }
-
- //had:
- //* @exception bad_value PROPAGATED
- //* @exception general PROPAGATED
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Make a radio button in the current style with some defaults. We
- * assume you are going to use constraints or direct setting to
- * position this object.
- *
- * @param toggle group_with what other toggle this radio_button
- * should be grouped with (if you pass
- * null here the radio button is "free
- * standing" and should probably be a
- * checkbox instead).
- * @param callback_object co the object to send the callbacks to.
- */
- public radio_button(toggle group_with, callback_object co)
- {
-
- // default to the artkit look temporarily
- super(0,0,co);
-
- /* set the style stuff going */
- style_changed();
-
- /* set the toggle you are with */
- if (group_with!=null) {
- add_to_group_of(group_with);
- }
-
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * The style has changed, regenerate.
- */
- public void style_changed() {
- loaded_image img[];
-
- img=style_manager.current_style().radio_button_make_images();
-
- /* set the images into the slots of the multibutton */
- set_state_look(0,img[0]);
- set_state_look(1,img[1]);
-
- /* now see if they have transitions */
- img=style_manager.current_style().radio_button_make_transitions();
-
- /* if null, we are done */
- if (img==null) return;
-
- /* they want transitions */
- set_transition_look(0,img[0]);
- set_transition_look(1,img[1]);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-